package leecode

func multiplyM(A int, B int) int {
	var result int
	//闭包
	var temp func(A, B int)
	temp = func(A, B int) {
		//递归终止条件
		if B == 0 {
			return
		}
		B--
		result += A
		temp(A, B)
	}
	temp(A, B)
	return result
}
